package math;

import io.GPSPoint;

import java.util.List;

import ui.TimeSeriesName;

public abstract class AbstractStatsProvider implements StatisticProvider {

	List<GPSPoint> gpsTracks;

	double[] values = null;

	long[] times = null;

	abstract void doWork();
	
	@Override
	public long[] getTimes() {
		if (times == null) {
			throw new IllegalAccessError("Times must be set");
		}
		return times;
	}

	@Override
	public double[] getValues() {
		if (values == null) {
			throw new IllegalAccessError("Values must be set");
		}
		return values;
	}

	@Override
	public void setTrack(List<GPSPoint> gpsTracks) {
		this.gpsTracks = gpsTracks;
		doWork();
	}

}
